package com.brainardphotography.blog.web.admin;

import java.util.logging.Logger;

import com.brainardphotography.blog.BlogEntry;
import com.google.sitebricks.At;
import com.google.sitebricks.Show;
import com.google.sitebricks.http.Get;
import com.google.sitebricks.http.Post;

@At("/admin/blogEntry/")
@Show("BlogEntry.html")
public class NewBlogEntryPage extends BlogEntryForm {
	private static final long serialVersionUID = -217641363891535356L;

	private static final Logger log = Logger.getLogger(NewBlogEntryPage.class.getName());
	
	public NewBlogEntryPage() {
		setEntry(new BlogEntry());
	}

	@Get()
	public void get() {
		setEntry(new BlogEntry());
	}

	@Post()
	public String post() {

		saveEntry();
		
		return "/admin";
	}
}
